#include<iostream>
#include<unistd.h>
#include<string>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


using namespace std;
 

 string terminal = "/dev/pts/3";

 int OpenTerminal()
 {
    int fd = open(terminal.c_str(), O_WRONLY);
    if(fd < 0)
    {
        cerr<<"open terminal error"<<endl;
        return 1;
    }

    dup2(fd, 2);

    // printf("hello linux\n");
    cout<<"fd: "<<fd<<endl;

    close(fd);
 }